a11y: Set the role on GtkSearchBar
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 12 Nov 2020 14:54:39 +0000 (14:54 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 12 Nov 2020 21:46:06 +0000 (21:46 +0000)
The search bar widget has a "SEARCH" landmark role, which is described
as:

    A landmark region that contains a collection of items and
    objects that, as a whole, combine to create a search facility.

gtk/gtksearchbar.c

index d7590bb7072a781cfa0c845c1561db4746a38613..c1a23bf304c2da22cc7aa3f839aef1fa8ccd9ec6 100644 (file)
  * ## Creating a search bar
  *
  * [A simple example](https://gitlab.gnome.org/GNOME/gtk/tree/master/examples/search-bar.c)
+ *
+ * # Accessibility
+ *
+ * GtkSearchBar uses the %GTK_ACCESSIBLE_ROLE_SEARCH role.
  */
 
 typedef struct _GtkSearchBarClass   GtkSearchBarClass;
@@ -336,6 +340,7 @@ gtk_search_bar_class_init (GtkSearchBarClass *klass)
 
   gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
   gtk_widget_class_set_css_name (widget_class, I_("searchbar"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_SEARCH);
 }
 
 static void